how to process image data in python